public class FindDuplicate {

	public static void main (String[] args) {	
		System.out.println(findDuplicate(args));	
	}
	
	//@ public normal_behavior
	//@ requires (\forall int i ; i >= 0 && i < arr.length; (\forall int j; j>i && j<arr.length; arr[i]!=arr[j]));
	//@ ensures \result == null; 
	//@ also
	//@ requires (\exists int i ; i >= 0 && i < arr.length; (\exists int j; j>i && j<arr.length; arr[i]==arr[j]));
	//@ ensures \result != null;
	//@ also
	//@ public exceptional_behavior
	//@ requires arr == null || (\exists int i; i >= 0 && i < arr.length; arr[i]==null);
	//@ signals_only NullPointerException;
	public static String findDuplicate(String[] arr) {

		HashTable tab = new HashTable( 100 );

		for ( int i = 0; i < arr.length; i++ ) {
			if ( tab.contains( arr[i] ) )
				return arr[i];	    
			tab.add( arr[i] );
		}

		return null;
	}

}